# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals

from django.conf.urls import patterns, url
from django.contrib.auth.views import login
from article import views
from article.views import ArticleList, SortArticleList, ArticleDetail, ArticleCreate, ArticleDelete, ArticleUpdate, \
    ArticleManage, UserCreate

urlpatterns = [
    #方法视图
    # url(r'^$', views.index, name='index'),
    url(r'^login/$', login, name='login'),
    # url(r'^register/$', views.user_register, name='register'),
    url(r'^logout/$', views.user_logout, name='logout'),
    # url(r'^article_add/$', views.article_add, name='article_add'),
    # url(r'^article_del/(?P<pk>\d+)/$', views.article_del, name='article_del'),
    # url(r'^article_see/(?P<pk>\d+)/$', views.article_see, name='article_see'),
    # url(r'^sort_see/(?P<sort>\w+)/$',views.sort_see,name='sort_see'),
    # url(r'^my_admin/$',views.article_manage,name='my_admin'),
    # url(r'^article_edit/(?P<id>\d+)$',views.article_edit,name='article_edit'),

    #类视图
    url(r'^article/$',ArticleList.as_view(),name='index'),
    url(r'^article/(?P<pk>\d+)/$',ArticleDetail.as_view(),name='article_see'),
    url(r'^article/(?P<sort>\w+)/$',SortArticleList.as_view(),name='sort_see'),
    url(r'^article_add/$',ArticleCreate.as_view(),name='article_add'),
    url(r'^article_del/(?P<pk>\d+)$',ArticleDelete.as_view(),name='article_del'),
    url(r'^article_edit/(?P<pk>\d+)$',ArticleUpdate.as_view(),name='article_edit'),
    url(r'^article_manage/$',ArticleManage.as_view(),name='my_admin'),
    url(r'^register/$',UserCreate.as_view(),name='register')

]
